package com.rybbaby.tss.front.tssStudent.dao.imp;

import com.rybbaby.tss.core.web.dao.imp.GenericDao;
import com.rybbaby.tss.front.tssStudent.dao.ITssStudentImportDao;
import com.rybbaby.tss.front.tssStudent.entity.TssStudentExport;
import org.springframework.stereotype.Repository;

import java.util.List;
/**
 * 导入服务相关实现
 * 杨然
 * 2017年12月1日 10:18:46
 * */
@Repository
public class ITssStudentImportImp extends GenericDao<TssStudentExport> implements ITssStudentImportDao {

    //验证幼儿信息重复
    @Override
    public List<TssStudentExport> findListByConditions(String name, String nickName, Integer sex) {
        String sql = "select a.id, a.name, a.nickName, a.sex from tss_student a where a.name in('"+name+"') and a.nickName in('"+nickName+"') and a.sex = "+sex;
        try {
            List<TssStudentExport> listBySql = super.findListBySql(sql, TssStudentExport.class, null);
            if (!listBySql.isEmpty()){
                return listBySql;
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }

}
